<template>
  <div>
      <el-form :model="articleForm" ref="articleForm">
        <el-form-item label="标题" >
          <el-input type="text" v-model="articleForm.title"  autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="目录cid" >
          <el-input type="text" v-model.number="articleForm.cid"  autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="描述" >
          <el-input type="text" v-model="articleForm.desc" autocomplete="off" ></el-input>
        </el-form-item>
        <el-form-item label="文章内容" >
          <el-input type="text" v-model="articleForm.Content" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="文章图片链接" >
          <el-input type="text" v-model="articleForm.img" autocomplete="off" ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="returnPrev()">取 消</el-button>
        <el-button type="primary" @click="addArticle()">确定</el-button>
      </div>
  </div>
</template>

<script>
export default {
  name: "EditArticle",
  data() {
    return {
      articleForm: {
      },
    }
  },
  methods: {
    getArtData(){
      this.articleForm = this.$route.query.artData
      console.log(this.articleForm)
    },
    returnPrev(){
      this.$router.push({
        path: '/admin/artList',
      })
      //刷新页面
      this.$router.go(0)
    }
  },
  created() {
    //html页面加载之前执行
    this.getArtData()

  },
}
</script>

<style scoped>

</style>
